package CPOO;

import java.io.File;

public class ImageFilter extends javax.swing.filechooser.FileFilter
{
	public boolean accept(File f) 
	{
		if ( f.isDirectory() || 
			 f.getAbsolutePath().endsWith(".jpg") ||
			 f.getAbsolutePath().endsWith(".jpeg") ||
			 f.getAbsolutePath().endsWith(".png") ||
			 f.getAbsolutePath().endsWith(".tiff") ||
			 f.getAbsolutePath().endsWith(".tif") ||
			 f.getAbsolutePath().endsWith(".bmp") ||
			 f.getAbsolutePath().endsWith(".gif")) 
			return true;
		else 
			return false;
	}

	public String getDescription() 
	{
		return "Pliki obrazów";
	}
}